let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n119,
                    i =
                    (this && this.__extends) ||
                    ((_n119 = function n(t, e) {
                            return (_n119 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n119(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        }),
                    r =
                    (this && this.__decorate) ||
                    function(t, e, o, n) {
                        var i,
                            r = arguments.length,
                            a =
                            r < 3 ?
                            e :
                            null === n ?
                            (n = Object.getOwnPropertyDescriptor(e, o)) :
                            n;
                        if (
                            'object' ==
                            (typeof Reflect === 'undefined' ?
                                'undefined' :
                                typeof(Reflect)) &&
                            'function' == typeof Reflect.decorate
                        )
                            a = Reflect.decorate(t, e, o, n);
                        else
                            for (var s = t.length - 1; s >= 0; s--) {
                                (i = t[s]) &&
                                (a = (r < 3 ? i(a) : r > 3 ? i(e, o, a) : i(e, o)) || a);
                            }
                        return r > 3 && a && Object.defineProperty(e, o, a), a;
                    };
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.MainPanel = void 0);
                var a = t('UIPanel'),
                    s = t('UIViewRes'),
                    c = t('UILayer'),
                    l = t('MainTabCom'),
                    u = t('ComUtils'),
                    h = t('SoundMrg'),
                    p = t('PropertyCom'),
                    f = t('PlayerMrg'),
                    d = t('AbsInfo'),
                    g = t('ChapterPanel'),
                    _ = t('BagMrg'),
                    y = t('CivilizationPanel'),
                    C = t('StorePanel'),
                    m = t('MilitaryPanel'),
                    v = t('CardPanel'),
                    b = t('MilitaryMrg'),
                    M = t('UIMrg'),
                    I = t('BuyVitPanel'),
                    A = t('CivilizationMrg'),
                    w = t('CardMrg'),
                    P = t('StoreMrg'),
                    U = t('PowerCom'),
                    O = t('GeneralTips'),
                    S = t('ConstantCfg'),
                    T = t('UIEvent'),
                    B = t('LangCfg'),
                    L = cc._decorator,
                    R = L.ccclass,
                    j =
                    (L.property,
                        (function(t) {
                            function e() {
                                return (null !== t && t.apply(this, arguments)) || this;
                            }
                            return (
                                i(e, t),
                                (e.prototype.onInit = function() {
                                    t.prototype.onInit.call(this),
                                        (this._layout = u.default.getComponent(
                                            cc.Layout,
                                            this.view,
                                            'bottomCom/layout'
                                        )),
                                        (this._imgLayoutBg = u.default.getNode(
                                            this.view,
                                            'bottomCom/wendiban'
                                        )),
                                        (this._powerValue = new U.PowerCom(
                                            u.default.getNode(this.view, 'topCom/pwoerVal')
                                        )),
                                        this._powerValue.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchPropertyHandler,
                                            this
                                        ),
                                        (this._goldValue = new p.PropertyCom(
                                            u.default.getNode(this.view, 'topCom/goldVal')
                                        )),
                                        this._goldValue.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchPropertyHandler,
                                            this
                                        ),
                                        (this._diamondValue = new p.PropertyCom(
                                            u.default.getNode(this.view, 'topCom/diamondVal')
                                        )),
                                        this._diamondValue.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchPropertyHandler,
                                            this
                                        ),
                                        (this._btnStore = new l.MainTabCom(
                                            u.default.getNode(this.view, 'bottomCom/layout/btnStore')
                                        )),
                                        this._btnStore.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchMainBtnHandler,
                                            this
                                        ),
                                        this._btnStore.on(
                                            T.UIEvent.Changed,
                                            this.onTabChangedHandler,
                                            this
                                        ),
                                        (this._btnCivilization = new l.MainTabCom(
                                            u.default.getNode(
                                                this.view,
                                                'bottomCom/layout/btnCivilization'
                                            )
                                        )),
                                        this._btnCivilization.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchMainBtnHandler,
                                            this
                                        ),
                                        this._btnCivilization.on(
                                            T.UIEvent.Changed,
                                            this.onTabChangedHandler,
                                            this
                                        ),
                                        (this._btnBattle = new l.MainTabCom(
                                            u.default.getNode(this.view, 'bottomCom/layout/btnBattle')
                                        )),
                                        this._btnBattle.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchMainBtnHandler,
                                            this
                                        ),
                                        (this._btnBattle.selected = !0),
                                        this._btnBattle.on(
                                            T.UIEvent.Changed,
                                            this.onTabChangedHandler,
                                            this
                                        ),
                                        (this._btnHero = new l.MainTabCom(
                                            u.default.getNode(this.view, 'bottomCom/layout/btnHero'),
                                            S.ConstantCfg.ins.getValue(13)
                                        )),
                                        this._btnHero.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchMainBtnHandler,
                                            this
                                        ),
                                        this._btnHero.on(
                                            T.UIEvent.Changed,
                                            this.onTabChangedHandler,
                                            this
                                        ),
                                        (this._btnCard = new l.MainTabCom(
                                            u.default.getNode(this.view, 'bottomCom/layout/btnCard'),
                                            S.ConstantCfg.ins.getValue(12)
                                        )),
                                        this._btnCard.on(
                                            cc.Node.EventType.TOUCH_END,
                                            this.onTouchMainBtnHandler,
                                            this
                                        ),
                                        this._btnCard.on(
                                            T.UIEvent.Changed,
                                            this.onTabChangedHandler,
                                            this
                                        ),
                                        this.addCom(this._powerValue),
                                        this.removeListenerTouch(),
                                        this.dealWithLayout();
                                }),
                                (e.prototype.onLang = function() {
                                    t.prototype.onLang.call(this);
                                    var e = u.default.getComponent(
                                        cc.Label,
                                        this._btnStore.view,
                                        'txtLabel'
                                    );
                                    (e.string = B.LangCfg.ins.getContent(200200)),
                                    ((e = u.default.getComponent(
                                        cc.Label,
                                        this._btnCivilization.view,
                                        'txtLabel'
                                    )).string = B.LangCfg.ins.getContent(200201)),
                                    ((e = u.default.getComponent(
                                        cc.Label,
                                        this._btnBattle.view,
                                        'txtLabel'
                                    )).string = B.LangCfg.ins.getContent(200202)),
                                    ((e = u.default.getComponent(
                                        cc.Label,
                                        this._btnHero.view,
                                        'txtLabel'
                                    )).string = B.LangCfg.ins.getContent(200203)),
                                    ((e = u.default.getComponent(
                                        cc.Label,
                                        this._btnCard.view,
                                        'txtLabel'
                                    )).string = B.LangCfg.ins.getContent(200204));
                                }),
                                (e.prototype.getCivilizationCom = function() {
                                    return this._btnCivilization;
                                }),
                                (e.prototype.getBattleCom = function() {
                                    return this._btnBattle;
                                }),
                                (e.prototype.getCardCom = function() {
                                    return this._btnCard;
                                }),
                                (e.prototype.onShow = function() {
                                    t.prototype.onShow.call(this),
                                        this._isInitComs ||
                                        ((this._isInitComs = !0),
                                            A.CivilizationMrg.ins.setBind(this._btnCivilization),
                                            f.PlayerMrg.ins.setBind(this._btnBattle),
                                            w.CardMrg.ins.setBind(this._btnCard),
                                            P.StoreMrg.ins.setBind(this._btnStore),
                                            b.MilitaryMrg.ins.setBind(this._btnHero),
                                            f.PlayerMrg.ins.on(
                                                d.InfoEvent.PropertyChanged,
                                                this.onPropertyChanged,
                                                this
                                            ),
                                            f.PlayerMrg.ins.on(
                                                d.InfoEvent.ChapterChanged,
                                                this.onChapterChangedHandler,
                                                this
                                            ),
                                            _.BagMrg.ins.addCountEvent(
                                                _.BagMrg.GOLD,
                                                this.onPropertyChanged,
                                                this
                                            ),
                                            _.BagMrg.ins.addCountEvent(
                                                _.BagMrg.DIAMOND,
                                                this.onPropertyChanged,
                                                this
                                            ),
                                            this.addCom(this._powerValue),
                                            this.onPropertyChanged(),
                                            this.onChapterChangedHandler()),
                                        h.SoundMrg.mainMusic(),
                                        this.showPanel(l.MainTabCom.SelectBtn),
                                        this.delayCall(0.3, function() {
                                            f.PlayerMrg.ins.hasGuide(1) ?
                                                f.PlayerMrg.ins.showGuide(1) :
                                                f.PlayerMrg.ins.hasGuide(3) ?
                                                _.BagMrg.ins.getCount(_.BagMrg.GOLD) >=
                                                A.CivilizationMrg.ins.sciences[0].money &&
                                                f.PlayerMrg.ins.showGuide(3) :
                                                f.PlayerMrg.ins.hasGuide(4) ?
                                                f.PlayerMrg.ins.showGuide(4) :
                                                f.PlayerMrg.ins.chapter.id >
                                                S.ConstantCfg.ins.getValue(12) &&
                                                (f.PlayerMrg.ins.hasGuide(5) ?
                                                    f.PlayerMrg.ins.showGuide(5) :
                                                    f.PlayerMrg.ins.hasGuide(6) &&
                                                    f.PlayerMrg.ins.showGuide(6));
                                        });
                                }),
                                (e.prototype.onTabChangedHandler = function() {
                                    this.delayCall(0.01, this.dealWithLayout);
                                }),
                                (e.prototype.dealWithLayout = function() {
                                    var t, e;
                                    l.MainTabCom.SelectBtn && l.MainTabCom.SelectBtn.selected ?
                                        ((t = 0), (e = 710)) :
                                        ((t = 25), (e = 660)),
                                        t != this._layout.paddingLeft &&
                                        (cc
                                            .tween(this._layout)
                                            .to(0.1, {
                                                paddingLeft: t
                                            })
                                            .start(),
                                            cc
                                            .tween(this._imgLayoutBg)
                                            .to(0.1, {
                                                width: e
                                            })
                                            .start());
                                }),
                                (e.prototype.onChapterChangedHandler = function() {
                                    var t = f.PlayerMrg.ins.chapter;
                                    t &&
                                        (this._btnBattle.checkOpen(t.id),
                                            this._btnStore.checkOpen(t.id),
                                            this._btnCard.checkOpen(t.id),
                                            this._btnHero.checkOpen(t.id),
                                            this._btnCivilization.checkOpen(t.id));
                                }),
                                (e.prototype.onTouchMainBtnHandler = function(t) {
                                    var e = t;
                                    e.enabled ?
                                        ((e.selected = !0),this.showPanel(e)) : 
                                        O.GeneralTips.show(
                                            B.LangCfg.ins.getContent(1015, {
                                                n: e.openLevel
                                            })
                                        ),
                                        h.SoundMrg.click();
                                }),
                                (e.prototype.showPanel = function(t) {
                                    switch (t) {
                                        case this._btnStore:
                                            M.UIMrg.show(C.StorePanel);
                                            break;

                                        case this._btnCivilization:
                                            M.UIMrg.show(y.CivilizationPanel);
                                            break;

                                        case this._btnBattle:
                                            M.UIMrg.show(g.ChapterPanel);
                                            break;

                                        case this._btnHero:
                                            M.UIMrg.show(m.MilitaryPanel);
                                            break;

                                        case this._btnCard:
                                            M.UIMrg.show(v.CardPanel);
                                    }
                                }),
                                (e.prototype.onTouchPropertyHandler = function(t) {
                                    var e;
                                    switch (t) {
                                        case this._powerValue:
                                            M.UIMrg.show(I.BuyVitPanel);
                                            break;

                                        case this._goldValue:
                                            (this._btnStore.selected = !0),
                                            (e = M.UIMrg.getPanel(C.StorePanel)) &&
                                            e.scrollToBottom(),
                                                M.UIMrg.show(C.StorePanel);
                                            break;

                                        case this._diamondValue:
                                            (this._btnStore.selected = !0),
                                            (e = M.UIMrg.getPanel(C.StorePanel)) && e.scrollToTop(),
                                                M.UIMrg.show(C.StorePanel);
                                    }
                                    h.SoundMrg.click();
                                }),
                                (e.prototype.onPropertyChanged = function() {
                                    this._powerValue.value = f.PlayerMrg.ins.power; 
                                    this._goldValue.value = _.BagMrg.ins.getCount(
                                        _.BagMrg.GOLD
                                    );
                                    this._diamondValue.value = _.BagMrg.ins.getCount(
                                        _.BagMrg.DIAMOND
                                    );
                                }),
                                (e.RES = new s.UIViewRes(
                                    'MainView',
                                    'Main',
                                    c.UILayer.MainLayer
                                )),
                                r([R('MainPanel')], e)
                            );
                        })(a.default));
                (o.MainPanel = j), console.log("end");
            module.exports =  e.exports;